﻿<?php
class Model_News extends Zend_Db_Table_Abstract
{
	protected $_name = 'news';

	public function createNews ($n_tieude, $n_noidung, $n_anhdd)
	{
		$rowNews= $this->createRow();
		if ($rowProduct) {
			// update the row values
			$rowNews->n_tieude = $n_tieude;
			$rowNews->n_noidung = $n_noidung;
			$rowNews->n_anhdd = $n_anhdd;
			$date = new Zend_Date();
			$date = $date->toString('Y-M-d HH:m:s');
			$rowNews->n_ngay = $date;
			$rowNews->save();					
			return $rowNews;
		} else {
			throw new Zend_Exception("Không thể tạo tin này!!!");
		}
	}
	
}
